/**
 * File    : PersonaManagerImpl.java
 * Created : 2008-10-10
 * By      : LuHuiguo
 */
package com.luhuiguo.sso.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import com.luhuiguo.sso.dao.PersonaDao;
import com.luhuiguo.sso.entity.Persona;
import com.luhuiguo.sso.service.PersonaManager;

/**
 * @author LuHuiguo
 * @version $Id: PersonaManagerImpl.java 9 2008-10-12 12:51:20Z LuHuiguo $
 * 
 */
public class PersonaManagerImpl implements PersonaManager {

	private PersonaDao personaDao;

	@Required
	public void setPersonaDao(PersonaDao personaDao) {
		this.personaDao = personaDao;
	}

	@Override
	@Transactional(readOnly = true)
	public Persona getPersona(Long id) {
		return personaDao.get(id);
	}

	@Override
	public void updatePersona(Persona persona) {
		personaDao.update(persona);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Persona> getAllPersona(int... rowStartIdxAndCount) {
		return personaDao.findAll(rowStartIdxAndCount);
	}

	@Override
	public void createPersona(Persona persona) {
		personaDao.create(persona);
	}

	@Override
	public void deletePersona(Long id) {
		personaDao.delete(id);
	}

	@Override
	public void deletePersona(Persona persona) {
		personaDao.delete(persona);
	}

}
